package com.example.protocol;

import com.example.message.LoginRequestMessage;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
import io.netty.handler.logging.LoggingHandler;

/**
 * @Description
 * @Date 2021/7/21
 * @Created by Jonathan
 */
public class TestMessageCodec {
    public static void main(String[] args) {
        EmbeddedChannel channel = new EmbeddedChannel(
                new LengthFieldBasedFrameDecoder(1024, 12, 4, 0, 0),
                new LoggingHandler(),
                new MessageCodec());
        LoginRequestMessage loginRequestMessage = new LoginRequestMessage("1", "2");
        channel.writeOneInbound(loginRequestMessage);

    }
}
